﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mighty.Common;

namespace Mighty.Brain
{
    public class CJBrain : BasicBrain
    {

        public override void GameStartEvent()
        {
        }

        public override Betting BettingTicEvent()
        {
            Betting betting = new Betting();
            betting.isPass = true;



            return betting;
        }

        public override HandedCard RoundTicEvent()
        {



            for (int i = 0; i < 10; i++)
            {
                if ((gameInfo.myCards[i].shape == gameInfo.round.cardStack[0].shape)&&(gameInfo.myCards[i].number < 9))
                {
                    return gameInfo.myCards[i];
                }
                else if(gameInfo.myCards[i].number < 9 && gameInfo.myCards[i].isPossible)
                {
                    return gameInfo.myCards[i];
                   
                }
            }

            for(int i = 0; i<10;i++)
            {
                if (gameInfo.myCards[i].isUsed != true)
                    return gameInfo.myCards[i];
            }
                return null;
            


        }
    }
}
